package org.windowkit.toolkit.widget.tree;

import java.util.EventObject;

/**
 * The event object that represents a move occurring.
 *
 * @author oconnellr
 *
 */
@SuppressWarnings("serial")
public class TwoTieredTreeMoveEvent<E> extends EventObject{

    private E itemThatMoved;
    private String newFolder;
    private String oldFolder;

    public TwoTieredTreeMoveEvent(final Object source, final E itemMoving,
            final String oldHome, final String newHome) {
        super(source);
        setItemThatMoved(itemMoving);
        setNewFolder(newHome);
        setOldFolder(oldHome);
    }

    /**
     * @return Returns the itemThatMoved.
     */
    public E getItemThatMoved() {
        return itemThatMoved;
    }

    /**
     * @param itemThatMoved The itemThatMoved to set.
     */
    public void setItemThatMoved(final E itemThatMoved) {
        this.itemThatMoved = itemThatMoved;
    }

    /**
     * @return Returns the newFolder.
     */
    public String getNewFolder() {
        return newFolder;
    }

    /**
     * @param newFolder The newFolder to set.
     */
    public void setNewFolder(final String newFolder) {
        this.newFolder = newFolder;
    }

    /**
     * @return Returns the oldFolder.
     */
    public String getOldFolder() {
        return oldFolder;
    }

    /**
     * @param oldFolder The oldFolder to set.
     */
    public void setOldFolder(final String oldFolder) {
        this.oldFolder = oldFolder;
    }


    public interface TwoTieredTreeMoveListener<E> {
        public void itemHasMoved(TwoTieredTreeMoveEvent<E> evnt);
    }

}